package de.ff7rl.core.serialize;

import java.util.HashMap;
import java.util.Map;

public class SaveState {

  private final String version = "1";
  private final Map<String, Map<String, Object>> saveData = new HashMap<String, Map<String, Object>>();

  public Object get(final String theCategory, final String theKey) {
    final Map<String, Object> categoryData = saveData.get(theCategory);
    if (categoryData == null) {
      return null;
    }
    return categoryData.get(theKey);
  }

  public String getVersion() {
    return version;
  }

  public void put(final String theCategory, final String theKey, final Object theValue) {
    Map<String, Object> categoryData = saveData.get(theCategory);
    if (categoryData == null) {
      categoryData = new HashMap<String, Object>();
      saveData.put(theCategory, categoryData);
    }
    categoryData.put(theKey, theValue);
  }

}
